package com.cms.common.model.entity;

import lombok.Data;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import java.util.List;

/**
 * 角色
 */
@Data
@Entity
public class Roles extends BaseEntity {
    private String name;
    @ManyToMany(targetEntity = Permission.class, cascade= CascadeType.REFRESH,fetch = FetchType.EAGER)
    private List<Permission> permissions = null;
}
